package com.group.project.hrms.utils;

import com.group.project.hrms.entity.SystemEventLog;
import com.group.project.hrms.service.ISystemEventLogService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Date;

public class LogUtil {

    @Autowired
    private ISystemEventLogService iSystemEventLogService;


    /**
     * 创建系统访问日志
     * @param staffName 谁
     * @param date 在什么时间
     * @param doSomething 做了什么
     * @param type 事件类型
     */
    public void insertSystemEventLog(String staffName, Date date, String doSomething, String type){
        SystemEventLog systemEventLog = new SystemEventLog();
        systemEventLog.setcTime(date);
        systemEventLog.setOperator(staffName);
        systemEventLog.setDetails(doSomething);
        systemEventLog.setType(type);
        iSystemEventLogService.insertSystemEventLog(systemEventLog);
    }


}
